package com.heather.exam.service.impl;

import com.heather.exam.mapper.CodeMapper;
import com.heather.exam.pojo.table.Code_suit;
import com.heather.exam.service.CodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CodeServiceImpl implements CodeService {
    @Autowired
    CodeMapper codeMapper;

    @Override
    public void save(Code_suit codeSuit) {
        codeMapper.insert(codeSuit);
    }

    @Override
    public List<Code_suit> check(String email) {
        return codeMapper.selectEmail(email);
    }

    @Override
    public String getCode(String email) {
        return codeMapper.getCode(email);
    }

    @Override
    public void delete(String email) {
        codeMapper.deleteByEmail(email);
    }
}
